{% extends "main_template.html" %}

{% block sectionnav %}
  <ul>
  {%for raid in raids %}
     <li><a href="/sk/admin/{{raid.pk}}"/>{{raid.instance}} {{raid.start_time}}</a></li>
  {%endfor%}
  </ul>
  <ul>
  <li><a href="/sk/admin/logout">logout</a></li>
  </ul>

{% endblock %}

{% block content %}
<h1>SK Admin</h1>
<h2>{{raid}}</h2>




<form action="/sk/admin/{{raid.pk}}/" method="POST">
<table>
 <tr>
     <th colspan="3">&nbsp;</th>
     <td colspan="3">
       {{form.character}}
       <input type="submit" name="action" value="Add to raid"/> |
       {{form.newchar}}{{form.classes}}
       <input type="submit" name="action" value="New Character"/>
       
     </td>
 </tr>
 <tr>
  <td>In</td>
  <td>Rk</td>
  <td>Sel</td>
  <td>Char</td>
  <td>Loot</td>
  <td>Note</td>
 </tr>
{% for raider in raiders %}
  <tr>
     <td><input type="checkbox" name="confirmed" value="{{raider.char.character.id}}" {%if raider.char.confirmed %}checked="checked"{%endif%}/></td>
     <td>{{raider.rank}}</td>
     <td>{% if raider.char.confirmed %}<input type="radio" name="selectedchar" value="{{raider.char.character.id}}"/> {% endif %}</td>
     <td style="background-color:#{{raider.char.character.character_class.hex_colour}}" class="{%if raider.char.confirmed %}inraid{%else%}notinraid{%endif%}">
       <img src="/media/img/{{raider.char.character.character_class.icon}}" title="{{raider.char.character.character_class}}" width="16" height="16"/>
       {{raider.char.character.name}}
     </td>
     <td><ul class="lootlist">
        {% for s in raider.suicides %}
          <li class="{%if s.is_suicide %}notsk{%else%}issk{%endif%}">{{s.skorder}} {{s.item.name}}</li>
        {% endfor %}
        </ul>
     </td>
     <td>{{raider.char.note}}</td>
     
  </tr>
{% endfor %}
</table>
<table>
  <tr>
      <th><label for="id_bossid">{{form.bossid.label}}:</label></th>
      <td>{{form.bossid}}<input type="submit" name="action" value="Select Boss"/></td>
  </tr>
  <tr>
      <th><label for="id_lootitems">{{form.lootitems.label}}:</label></th>
      <td>{{form.lootitems}}</td>
  </tr>
</table>
<input type="submit" name="action" value="Assign loot and suicide"/>
<input type="submit" name="action" value="Assign loot"/>
</form>
{% endblock %}